package com.learn.excel;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;

@Slf4j
@EnableAsync
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(Application.class,args);
        Environment env = context.getEnvironment();
        log.info("====================================================================");
        log.info("项目名称: {}", env.getProperty("spring.application.name"));
        log.info("启动环境: {}", env.getProperty("spring.profiles.active"));
        log.info("启动端口: {}", env.getProperty("server.port"));
        log.info("Swagger: {}", Boolean.parseBoolean(env.getProperty("swagger.enabled")) ? "启用" : "禁用");
        log.info("Startup complete ...");
        log.info("====================================================================");
    }

}
